<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <button @click="student.name='张三'">改变</button>
        <p>
            {{student.name}}
        </p>
    </div>
</body>
<script src="./vue.min.js"></script>
<script>
    const vm = new Vue({
        el:"#app",
        data:{
            msg:"狗蛋",
            student:{
                name:"狗蛋"
            }
        }
    })
    //对象中的值使用深度监听
    vm.$watch("student",function(){
        alert("已经改变")
    },{
        deep:true
    })
</script>
</html>